package com.mj.common.sdk.api;

import com.mj.common.config.AppConfig;
import com.mj.common.sdk.beans.message.TextMessageCustom;
import com.mj.common.sdk.tools.HttpUtil;
import com.mj.common.util.JSONUtil;

/**
 * 客服发送消息
 * @author zhouping
 *
 */
public class MessageCustomCilent extends AbstractClient{
	
	 /**
     * 发送客服消息
     */
    public ApiResult sendCustomMessage(String jsonStr) {
        AccessToken accessToken = getAccessToken();
        String jsonResult = HttpUtil.post(AppConfig.WEI_XIN_CUSTOM + accessToken.getAccessToken(), jsonStr);
        return proceResult(jsonResult);
    }
    
    /**
     * 构建发送数据
     */
    public ApiResult sendTextMessage(TextMessageCustom textMessageCustom) {
        String jsonStr = JSONUtil.toJson(textMessageCustom);
        return sendCustomMessage(jsonStr);
    }
}
